﻿using System.Collections.Generic;
using Microsoft.Practices.EnterpriseLibrary.Validation.Configuration;
using System;

namespace AsNum.Common.EntLib.Validation.Adapters {
    /// <summary>
    /// 
    /// </summary>
    public class ContainsCharactersClientAdapter : BaseClientAdapter<ContainsCharactersValidatorData> {

        public ContainsCharactersClientAdapter(ContainsCharactersValidatorData data , Dictionary<string , Tuple<string , string>> map , bool isSub = false)
            : base ( data , map , isSub ) {

            this.AddRule ( RuleKeys.Str , string.Format ( "'{0}'" , this.ValidatorData.CharacterSet.JsSafeString ( ) ) );
            this.AddRule ( RuleKeys.Mode , string.Format ( "'{0}'" , this.ValidatorData.ContainsCharacters.ToString ( ) ) );
        }


        public override RuleTypes RuleType {
            get {
                return RuleTypes.Contains;
            }
        }
    }
}
